<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="__ROOT__/Public/Admin/css/shortcut icon" href="favicon.ico"> 
    <link href="__ROOT__/Public/Admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/animate.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/style.css?v=4.1.0" rel="stylesheet">
	<link href="__ROOT__/Public/Admin/css/jquery.treetable.css" rel="stylesheet"/>
	<link href="__ROOT__/Public/Admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
	<link href="__ROOT__/Public/Admin/css/official.css" rel="stylesheet">
    <style>
		::-webkit-scrollbar {
		    width: 6px;
		    background-color: #F5F5F5;
		    height: 8px;
		}
    </style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-content">
				<ul class="nav nav-tabs">
                    <li class="active"><a href="#"><i class="fa fa-user"></i> 列表</a>
                    </li>	
                </ul>
                <form class="well form-search form-inline" method="post" action="">
                    <div class="form-group">
                        <input type="text" class="input form-control" name="keyword"  value="{:I('request.keyword/s','')}" placeholder="请输入类型名称">
                    </div>
                    <button type="submit" class="btn btn-search"> <i class="fa fa-search"></i> 搜索</button>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <a class="delete-user label label-danger js-ajax-delete" style="padding: 9px 11px;border: 1px solid #cfdadd;" id="" href="javascript:deleteaAll();">删除</a>
                </form>
				<table class="table table-hover table-bordered table-list" id="cates-table">
					<thead id="thead">
						<tr>
							<th width="5%">序号</th>
							<th width="8%">模块名称</th>
							<th width="10%">方法名称</th>
							<th width="22%">操作语句</th>
							<th width="10%">操作时间</th>
							<th width="5%">操作</th>
						</tr>
					</thead>
					<tbody>
						<volist name="list" id="vo">
							<tr itemid="{$vo.ID}"> 
								<td>{$key + 1}</td>
								<td>{$vo.ModuleName}</td>
								<td>{$vo.Method}</td>
								<td>
									<div style=" overflow:hidden; width:600px; overflow:auto; line-height: 20px;">
										{$vo.SQL}	
									</div>
								</td>
								<td>{$vo.AddTime}</td>
								<td><a class="delete-user label label-danger js-ajax-delete" id="{$vo.ID}" href="javascript:deletea({$vo.ID});">删除</a></td>
							</tr>
							<if condition="$vo.coutsonID gt 0"><tr data-node-id="0" data-parent-id="{$vo.ID}"></tr></if>  
						</volist>
						<if condition="count($list) lt 1">
	                        <tr>
	                            <td colspan="6" class="text-center">查无数据</td>
	                        </tr>
                        </if>
					</tbody>
				</table>
				{$page}
			</div>
        </div>
    </div>
	<script src="__ROOT__/Public/Admin/js/jquery.js"></script>  
    <script src="__ROOT__/Public/Admin/js/treetable/jquery.treetable.js"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.min.js"></script>
	<script src="__ROOT__/Public/Admin/js/tableCheckbox.js"></script>
	<script>


		function deletea(id){
			$.post("{:U('Operatorlog/delete')}",{ID:id},function(result){
				if (result.status) {
	                swal({ 
						title: "操作成功！",  
						text: "删除日志！",  
						type: "success", 
						showCancelButton: false, 
						closeOnConfirm: false, 
						confirmButtonText: "返回" 
						}, function() { 
							document.location.reload();
					});
	            } else {
	                swal("操作失败！", result.info, "error");
	            }
			});
		}
		
		function deleteaAll(){
			var itemidStr = "";
			$("input[name='checkItem']:checkbox:checked").each(function(){ 
				itemidStr += $(this).parent().parent().attr("itemid")+",";
			});
			if(itemidStr != "" && itemidStr != undefined && (itemidStr.length > 0)){
				$.post("{:U('Operatorlog/delete')}",{IDS:itemidStr.substr(0,itemidStr.length-1)},function(result){
					if (result.status) {
		                swal({ 
							title: "操作成功！",  
							text: "删除日志！",  
							type: "success", 
							showCancelButton: false, 
							closeOnConfirm: false, 
							confirmButtonText: "返回" 
							}, function() { 
								document.location.reload();
						});
		            } else {
		                swal("操作失败！", result.info, "error");
		            }
				});
			}else{
				alert("未选中任何日志");
			}
		}
		
    </script>
<img src="__ROOT__/Public/Admin/img/loading.gif" class="loading" style="display:none;">
</body>
</html>